package  utils
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	/**
	 * ...
	 * @author FireKnight
	 */
	public final class CenterObj 
	{
		
		public function CenterObj() 
		{
			
		}
		
		public static function centerNumber(obj:DisplayObject,con:DisplayObjectContainer):Array
		{
			
			var stageW:Number = con.stage.stageWidth;
			var stageH:Number = con.stage.stageHeight;
			var target_x:Number = (stageW - obj.width) / 2;
			var target_y:Number = (stageH - obj.height) / 2;
			return [target_x,target_y];
		}
		
		public static 	function centerObj(obj:DisplayObject, con:DisplayObjectContainer):void
		{
			var target_x:Number;
			var target_y:Number;
			var arr:Array = centerNumber(obj, con);
			obj.x = arr[0];
			obj.y = arr[1];
		}
		
		
		
	}

}